-
Notifications
You must be signed in to change notification settings - Fork 336
Support for async callbacks #1284
Support for async callbacks #1284
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test where you receive two callbacks, one is sync and the other an async func? Plus lint with precommit. Thanks a ton! Also, pertaining to ordering, I can't actually remember my digging around of the code. In relation to your comment, dicts should be ordered now in supported Py3 versions, but I suppose it doesn't matter here 😅
Yeah, no problem, I'll add the test and have a look at the linter error. |
Codecov Report
@@ Coverage Diff @@
## master #1284 +/- ##
==========================================
- Coverage 90.66% 90.63% -0.03%
==========================================
Files 21 21
Lines 6870 6891 +21
Branches 884 885 +1
==========================================
+ Hits 6229 6246 +17
- Misses 469 471 +2
- Partials 172 174 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
I added a test case that uses both callback variants. The typing problem wasn't that easy to fix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution here!
Tests look good to me at this point!
What do these changes do?
As mentioned in #1235 you can't use coroutines as custom callbacks. This patch tries to fix that.
Are there changes in behavior for the user?
There shouldn't be any changes for the users as sync callbacks are still supported.
Related issue number
#1235
Checklist
CONTRIBUTORS.txt
<Name> <Surname>
.CHANGES/
folder<issue_id>.<type>
(e.g.588.bugfix
)issue_id
change it to the pr id after creating the PR.feature
: Signifying a new feature..bugfix
: Signifying a bug fix..doc
: Signifying a documentation improvement..removal
: Signifying a deprecation or removal of public API..misc
: A ticket has been closed, but it is not of interest to users.Fix issue with non-ascii contents in doctest text files.